/*
package com.neo.community.commons.util;

import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ResourceBundle;

import static java.lang.Integer.valueOf;

@Configuration
@Deprecated
public class EmailSendUtils {
    */
/**
     * 配置信息
     * email.host.name=smtp.163.com
     * email.smtp.port=465
     * email.authenticator.username=Leoncaption@163.com
     * email.authenticator.password=RFQRKKYMLDUTLPNV     授权码信息
     * email.from=Leoncaption@163.com
     *//*


    */
/**
     * spring自动创建SimpleEmail
     *//*

    @Autowired
    private Email email;

    private static String hostname;
    private static Integer port;
    private static String username;
    private static String password;

    //提前加载邮件发送相关的配置信息
    static {
        ResourceBundle bundle = ResourceBundle.getBundle("email");
        hostname = bundle.getString("hostname");
        port = valueOf(bundle.getString("port"));
        username = bundle.getString("username");
        password = bundle.getString("password");

    }

    */
/**
     * 发送普通邮件
     * @param subject 主题
     * @param msg 信息
     * @param to 收件人
     *//*

    void sendtext(String subject, String msg, String... to) throws EmailException {
        email.setHostName(hostname);
        email.setSmtpPort(port);
        //password为授权码
        email.setAuthenticator(new DefaultAuthenticator(username, password));
        email.setSSLOnConnect(true);
        email.setFrom("Leoncaption@163.com");
        email.setSubject(subject);
        email.setMsg(msg);
        email.addTo(to);
        email.send();
    }

    void sendhtml(String subject, String msg, String... to) throws EmailException, MalformedURLException {
        // Create the email message
        HtmlEmail email = new HtmlEmail();
        email.setHostName(hostname);
        email.addTo(to);
        email.setFrom("Leoncaption@163.com", "闲云网");
        email.setSubject(subject);

        // embed the image and get the content id
        URL url = new URL("http://www.apache.org/images/asf_logo_wide.gif");
        String cid = email.embed(url, "Apache logo");

        // set the html message
        email.setHtmlMsg("<html>The apache logo - <img src=\"cid:"+cid+"\"></html>");

        // set the alternative message
        email.setTextMsg(msg);

        // send the email
        email.send();
    }

}
*/
